package com.jiuwan.gamepass.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @version 1.0
 * 功能目的描述 ：用于   将字符串 分拆为单个url地址       ========>>>>>>>>>>>
 * @author： pang-yun
 * @date： 2021-06-24 17:26
 */

public class StringSplitUtil {


    public static List<String> urlSplit(String urlPath){
        ArrayList<String> list = new ArrayList<>();
        if (urlPath==null){
            return null;
        }
        String[] splitUrl = urlPath.split(",");
        for (String url: splitUrl){
            list.add(url);
        }
        return list;
    }


    public static void main(String[] args) {
        List<String> strings = urlSplit("http://10.41.0.37:8080/material/2f00b58a381f4acbbaec6072df5dcf27-icon-72.png,http://10.41.0.37:8080/material/1af6c0f1c4d94f1c94b5ff6fc4925f1c-icon-72@2x.png,http://10.41.0.37:8080/material/34374902eef24fa790c56f4e622f1f2c-icon-76.png,http://10.41.0.37:8080/material/fcc47af979f9439495cd1acf337485fe-icon-76@2x.png,http://10.41.0.37:8080/material/df33066a6f384ddd905cd2870ede9cfc-icon-83.5@2x.png,http://10.41.0.37:8080/material/932d3deff27c4d268e0689febfec5b98-icon-1024 - 副本 (2).png,http://10.41.0.37:8080/material/6b28b3f03c594d9391c4a1aca4bf7a52-icon-1024 - 副本 (3).png,");
       for (int i=0;i<strings.size();i++){
           System.out.println(strings.get(i));
       }
    }
}
